package learn.spring.auth.feign;

import java.util.List;
import java.util.Map;
import learn.spring.common.base.Result;
import learn.spring.common.dto.UserDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(value = "learn-api:8889")
public interface FeignService {

  @GetMapping("/api/user/{username}")
  Result getUserIdByName(@PathVariable String username);


  @GetMapping("/api/user-role/{userId}")
  Result getRoleIdsByUserId(@PathVariable String userId);

  @PostMapping("/api/role")
  Result getRolesByIds(@RequestBody List<String> roleIds);
}
